Switched to using enumerated type's ordinal() method