Didn't change anything, just organized code a tad

Aside from the slowness issue everything looks good.
I plan on stopping by his office hours tomorrow to ask for a way to
optimize the code.