a better way to create this PAT files