fixed up boolean function