Problem 3 no longer uses > 600 MB of RAM.