Maximizing rewards in reinforcement learning