added more debugging info and made easier to read