accumulator returns 0 when empty string passed in