Cleaned and commented all classes and fixed a few remaining bugs