js almost working