threshold for x and y instead of global