Initial trainer code (reading matrix)