added all classes and implemented main Method