use switches instead of ifs