pub/mrm code from rohan repo