Complete Q-Learning

Completed question 4, 5 and 7 based on single code updates.