erlang basic implementation