split function updated