added python script that demonstrates the algorithm