added some diagnostic output