resource monad in variable updates
resource monad in theory solver
remove unneccessary referencing