Iteration of q implemented