finished write code except for field data