changed variable names in onClick to distinguish from private X and Y