added reset and fixed headers
ran through unit test and fixed most kinks