a partial rewrite, for accuracy and clarity