easy way to implement boolean function