testing: move variables and add more debugging