Added more comments and cleaned up some files