Updated query for matrix to include both presence and absence.