functions: factorial, quadratic, references