made the js with rand