matrices rows or columns first