Improved Erlang parallel version