Finally got sum working