How to reset and how to set the memory function