mostly done matrix program