Feature/sort dictonary keys

If you already made a copy on line 15, I don't think you need to make a copy again.