Added clear index. still need to test.