change memory write order