added magma formula