Incorporating Dave's changes