added some debugging code, will delete when ready