Adding periodic (sine and cosine) functions back in

Confirmed: we do have periodic functions in the data sets.
Saving time by evaluating "c" and "d" conditionally

As suggested by Terry in Project #2b feedback.