A priority queue implementation in Erlang