initial commit of alg3.py