* Rewrite prototype python code