Started rewriting matrix tests