count words from a file and return map