Solved problem 15 - using too much memory!