See http://www.cs.wisc.edu/~cs838-1/Students/sohn/project2.html