added notes and completed coding
Merge branch 'r2_index'