Added an update function for the x and y labels