changed write to find alloc block