added very simple inverse-mode in calculatePercentage