create matrix generator, fix automated coding for csv generator