adding diagnostic output