defer reader close
output in reverse order by freq
changed the output format in reverse order