solve problem 11 (not proud of the code, a little rusty ;D)