outlined new sprite batch algorithm in comments