Source: https://www.inf.usi.ch/faculty/binder/documents/cpe09.pdf