switched to using izip to avoid creating list