Added reset pin and reset function