Some more modifications to the FileWritter function