changed bool into BOOL
revised is_nil functions
revised is_empty functions