introduced algorithm class, added config and result classes, refactoring