javascript/bob: First working solution