added code to follow optimal policy after learning