change to using slices instead of list containers; implement function for testing the proper construction of an index