code modified: sum to any