Code from 5/2011.