refactored findSum