some corrections

moved scripts to top of the page, $data to $displayand a+ became w+.
Still not quite there..