Javascript version from @_Kevinatari added