modify Matrix