fixed some bugs the transition function for gridworld. Overloaded << for Rational