Deleting the files under folder algorithm