Improvement to getXCoordinate()