Added pattern matching to check if list data sorted using As Patterns form