Fixing standalone Sum func and adding better documenttion