Source: http://www2.hawaii.edu/~robertop/Courses/TMP/3_Functions.pdf