javascript version working