Added front-to-back sorting for our boxes and cleaned up the sample.