changed from array index to pointer arith