turned both algs to objects, no static fields