added more debugging code