adding david's changes