update prime generator javascript