Order elements by most closely matching first