deleted unnecessary ifs