Added CSV writing, v1.0 complete