Added more comments and cleaned up some classes