in the middle of removing self-loops in graph queries