Added a lot of debug messages