use destructuring of xy parameter to x and y for efficiency