added python version of alg06