first draft of split complete with no code for random access files