Source: https://cs.jhu.edu/~jason/papers/vieira+al.mapl17.pdf