solved q2.39