general refactoring

now algs are classes and can run step by step and provide intermediate
results