implemented several algorithms, still needs tests