still working on deadlocks