k not q

For loop iterates wrong variable, fails.