added `nid` and `ni` functions