fixed matrix block reference issue and corrected formatting