Put matrix struct and functions into separate file