finished the split functionality