add some comments and change how the library is sorted

Signed-off-by: Benjamin Kaiser <benjaminjkaiser@gmail.com>
add index column and start work on row sorting (not complete)

Signed-off-by: Benjamin Kaiser <benjaminjkaiser@gmail.com>