Implemented and tested sorting threads by location proximity.