moved js to separate file