added file renaming function

Need to work on this more as this keeps on appending new date to
existing file name