Integrated front to back sorting quad tree