Added tests for add with index method.
Implemented add with index method.