add method insertElement into a special index