implementing quadrant tree as an example