Update for enum to accept -ve values

When using enum values, a value of a -ve number is not allowed because
it is implemented as an array. Changes the implementation to a hash to
accept -ve numbers