Cleaned up more old functions, now using lambda for visiting nodes