small piece of implementation of rtree