Add another algorithm. Quick and dirty, still needs some refactoring.