Cloned from http://sourceforge.net/p/dyi/code/HEAD/tree/