updated to use cid instead of id - take 1