erlang: implementing b-store