added a bunch of debug stuff