Initial implementation of quad tree