moved some JS around