use switch instead of multiple if's