Changed map structure, added sorted values to dictionary, updated search and sort