added debugging code.