working on write complex