finished js-racer1 but needs refactoring