Better value iteration algorithm