hash instead of case statement