- revised es6 version