Matrices doesn't work properly