added new tests for indexing function