Cleaned up the code in DP187Easy

It was really bad, with one-letter variable names and all sorts of
horribleness, but I did the refactoring thing, and now it's a lot
better. I also got rid of the massive amounts of really gross nested
functions and stuff, so that's good.