Implement splitAtIndex