changed the renameFiles method