Cleaned up some classes and added some comments in the code.