changed izip to pairwise, fixed issue