added diagnostic output