debugging code clean up
improved BOOL checks from BOOL value == YES and BOOL value == NO to (value) or (!value)
Conversion to instancetype from id and removal of debugging code