Initial code for XY handling
Now working properly