add a line chart; rename some variables

restart()   -> restartFreq()
myRestart() -> restart()
totalTime   -> cycleTime
use totalTime for the real total time
Move <script> out of <head>, to the bottom of <body>