Added some classes and fixed some bugs