function return both x, y