rile reoraganiztion
Better code to check whether external packages are installed