map and list examples with sorting their elements