added check for dependent tools and support for calling script from anywhere