Implemented length method using new function pairwise using itertools