CR changes: used hash lookup instead of array lookup