lots of debug stuff