Added reset and finished functions