Source: https://warwick.ac.uk/fac/sci/statistics/courses/morse.pdf