fixed reset bug and cleaned up code, added some NOTES wrt that