matrix rotate and reset