modified example for function of boolean