Made the boolean expression a function.