install script and a few improvements