fixed errors in code for q11 solution.