merged with Adams deadlocktesting fixed last parts.