removed unnecessary line, I had assigned Z value with C before loop, it was not necessary