Added class diagram, minor bug fixes