Adding matrix generator script, modifications to unroll code