add __main__ functionality