Implemented stats saving