finished jsanddom functions