corrected index for the multi dim array cm.