restructured, now using objects
the class for the object