Added the addAtIndex method