finish bigrams and output in correct order