collection of simple python algorithms and functions