Done (with minor modifications).