fixed matrix generation start