Updated example code to return a bool