in reply to 'split'-ting headache

There doesn't seem to be anything wrong with your code. What is your input, what is your output, and what did you expect as output?

Abigail