correct pointer arithmetic