Initial guess at MO-replacement code.