Implemented a context window based on pairs.