Writing a method that will run value iteration multiple times