Minor Clean up

Cleaned up some of the code and added some comments