Hash function now uses switch/case statements