Using match statements rather than if.