split montegomery function