index function declared
merged r2_index and master
fixed merging conflict