Ported Cloud9's example for bigram count