matrix generator done