Adding the quad tree code from the quad tree branch to the master