this is the initial script for the indexing (PSEUDO CODE)