categories check with anidated ifs