update index, add writing and code