running code to index