Second version all work correctly 

TODO Mocha test and modify something of style