from Daniel Shiffman's Nature of Code