python rewrite!