simplified, made browser-friendly, new dependency: inh