indexing code now filled in. test needed