some algorithms implementation on python