Siwtched to switch instead of using if-else else-if ladders