Merging Davids changes

Updating with latest changes.