functioning -b and a switch statement