Added index() and updated add()