fixed some bugs and added a UML