add indexAt method.