updated chnsts_to_oml function