change back to use x, y, z instead of array.