remove global x, y

x and y are only used locally and in closure-scope