Convert Interpretor to using a state monad