switch instead of ifs