add matrix reset function