adding some new classes and changing some of the logic