sum with functions as arguments