put executable code in __main__ (prevents MS Windows errors)