Problem 54 solved. Needs lots of refacatoring.