Javascript is awful, almost working tho