Added nested conditional to boolean function.