added some description to the splitList function, like psuedo code