added comparator_t and changed map constructor to use array instead of switch