Erlang interface to k-dimensional trees