cleaned up the commented code and added class comments