add better type checks and a reset property to prevent resets when not necessary
updating version