Algorithm done! Some testing passed.