implement file wrinting capability