use case statement instead of if/else