3ed optimiization

Moved the javascript to the end of the page