added comment for js func