Merged Dave's changes