use map to hold count for each character