Source: https://www.maths.ed.ac.uk/~ateckent/vacation_reports/summer_project_gillian_smith.pdf