Erlang revert to heaps.erl, modified