Updated for write.c