added a few classes and general algorithm - test later