what two factors change igneous and sedimentary rocks into metamorphic rocks