ordering matches properly