Beging some write to file work, not functional yet.