trying out subset 2  stuff with ifs and using isVar function