lots of debug messages added