Added index option to add method

This allows adding at a specified index in the internal array
Merged
resolve conflicts