some algorithm by python