moved code to body (js)