Improved speed of splitAtIndex().