Resolved some of the const reference issues. Replace BOOL with bool