poorly programmed quadtree implementation in pygame