compatible with 2.6
Use izip to reduce RAM usage