Made the script idempotent 

Made the script idempotent, so that one can run it twice and it will only install things that are missing.