updated buildIndex script to make life easier!