replaced var compare with inline fns (part 3)