re-write begins