tweaked copy, move javascript to the bottom