Update 2

add javascript implementation