Use global vars for x, y and r