added comments and redid 'reset' method