added reset and some functionality