Added a lot of code for dynamic visiting, still working on it