switched to new function get_nonlocal_dependencies