code cleanup, made all the classes more OOP, and added comments to all classes