Added iteration for k times.