added if __name__ in scripts, which seems to be required for windows