Updated install script and new application script template
Updated and optimized code with help from unix.com