revised all classes, more object oriented now