optimized reset logic -- Nathan implemented this.