start JavaScript logic