switched sortedlist to dictionary