Inlining variables in isBetween function.