rewrote most of the stuff
add split.c