write this function in just one script tag.