added debugging code