better move this if block before evaluating the switch block or even before the for-loop