filewriter works, still a bunch of bugs to iron out