added victor's changes from master branch