K2Tree implementation