solved problem 14 after some minor debugging