How about using `list.index` instead of building the positions dict?
```python
related.index(brain.UID)
```