Modified to support browser usage