Added reset method to clear all history; refactored example