Updated js snippet

As per #11