javascript/bob: First *actually* working solution