Added some delays and more debugging output.