porting python to erlang