use new algorithm for breaking deadlocks
use bitsets, not Set<Integer>s
fix some bugs