index function added to version 1.1
index function debugged in version 1.1