added a revised location sort. Please look over.