Made som code polish and implemented setInterval method in JS to update window.