changed n = n + 1 to n += 1