Shorten the xy operation method with some math