incorpporatd get_nbnid into get_ids, #332