move int u = 0 to this for loop, thanks.