clean up code and remove reset to rethink function