Updated the install script to handle dependencies better