added additional debugging functionality