made some changes to address barnards comments