code for finding bigrams and frequency count