spatial sorting