tried to separate js and html code