and added more debugging