use match_array instead of sort