Mind the dirty trick where the argument-list of the select function is partially unpacked in global variables. Those values of $x and $y are required later to have the selected object moved.
select
$x
$y