First implementation in Erlang