Python 3 implementations of various algorithms