beginning of split function added