updated with latest from upstream/master