Add public getter methods for private fields x and y.