new code for splitting