old mrm code from rohan repo