broke into two classes and updated version