Long and inefficient code for filling up Collaboration Matrix