Refer to the marker data directly since the index can go out of sync.
Better method and variable names.
Fix selected index.