Added __main__ logic