huge refactor and quadtree working