functional range finding in compare