Added collision sorting.