edit matrix