completed answer for problem 13, but ran out of memory - need to resolve.