updated with changes from master branch