improved device range sorting