add some python alg. code