Added QNetwork functionality. Added computation of discounted reward