added clear parameter to let user decide wether to wipe currently existing files or not