merged Dave and David's changes into same branch.