Index implementation completed. fixes #7