js, almost done