Source: https://cs.gmu.edu/~marks/211/textbook/04-methods.pdf