Fixed some bugs, added a reset button
added some documentation