Update functions.sh

package installation routine updated
code cleard