refactored precent off calculator into a method