Base version with deadlocks by roman