added the js wrapper implementation