Add file count function