Implementation of some of the algorithms in Python