Rewrite play2 using iterate