moved ft.write into class, close #1