Erlang n-body simulation