Debugging code for name histories problem