move Matrix to math