a lot of debug stuff added.