put script in an anonymous self-calling function and updated readme for github