Changed the filename generation function. Added GUID algorithm for generating unique filenames