Added problem 56
added helper functions to problem145