es6 variant of topdown