Final tests
Cleaned up a bit of debug stuff and added a couple of comments