rewrite using marksMatrix object