Based on googlecode r560 by John Voltz.
Based on googlecode r558 by John Voltz.
Based on googlecode r552 by John Voltz.