made a slightly clearer version on knuth's