start implementing file writing