edits to writePop