now take existing files into account