add index testing 1

copy from yihui's homepage