Fixed incorrect y-value iterations