Sorting particles correctly