added indexOf method, all tests passing