Matrix generation movet to Restart method