make script more pythonic
pep8 code style
add __name__=="__main__" guard