prettified helper function
tried to refactor structs into matrices