Source: https://www2.cs.arizona.edu/patterns/weaving/books/archive_009.pdf