Use leaves_containing instead of inner function to find nodes