As you can see, I just restructured the existing code - because it was more complicated than it needed to be. Please feel free to disregard this commit.