Sorting and Searching initial state