very crude matrix code generation also now works