putting together some base code for indexing documents