final revision w/ Dan's changes