Problem 12 fix

Bugs in problem 12 fixed, further testing probably still required