update to es6 and add a test