adding modifications from updated master branch