Added diagnostic output