Added option to specify index location.