Initial code for generating an index.