Added comments to describe different magma functions used