added more debug and tracing information to test