added __main__ check to the tool code