Reimplemented inverted fuction

Reasons:
  - calculation was ignored when quantities were missing for minuend