Updated to subtract for losses

Possibly still needs debugging