Added sprite sorting.