refactored the logic and included subtraction
Merge pull request #1 from xtina-starr/master

refactored the logic and included subtraction