Refactoring, added functions sum and splitNumbers