Fix sum to use inject(:+)