added many ifs