Map from ID to index