add 3rd problem and fixes to problem 2