let's see if the code is more readable with the accum function
new version of nsplit