prototype implementation of index.c; creates and validates an index