Rewritten to calculate integers instead of concatenating strings

- Removed string concatenation
- Added integer calculation