merged from lbovet master branch