making code look similair and starting work on adding new matrices