sort and count_words both work in map-r and non map-r