Now matching application to cid via a hash function. Much much faster.