added writing out of analysis to cdv format