Added reset and updated some variables.