add initialise index routine - probably needs more thought