Removed printf from sum function.