Syntax and other corrections from Brian MacMahon
David Brown's further adjustments and comments