write a new index