finished UML diagram, cleaned up code a bit