source and license A by David Revoy