Added reasoning behind pp and psd instead of just not creating the cp and csd variables respectively when they would point to invalid patterns or starting dates.