edited David's work