added some debugging code