converting returningArrays to Minimalasm