Starting to shape up. Might come back and completely rewrite this, though. It was just a test.