Refactored arithmetic to use return instead of echo