changed tile size
refactored the sorting so now it's all done at the beginning