Won’t crash when you try to add a circular dependency (e.g. drag a function into itself). Implementation ideas from @mgold.