Split/add and fixes

No, not ok.  I've updated the code to be correct and clearer (but not as concise).