Modified writing so stuff isn't overwritten