patched calculation of discount