Source: https://www.compsci.hunter.cuny.edu/~sweiss/resources/functions.pdf