modified erlang generation