implement to_erlang