Reverted types for some functions to parametric, but made them subtypes of Real
Rewrote notebook to use new code