added support for level 3, also added mocha test