rewriting simple algorithms in erlang