Formation of Igneous and Sedimentary rocks