working version of output to file.
Still problem with observation not being linked to edge