improve comment all function so that it handles file types