Added boolean function and logic