regen with frindlier javascript