Moved main program logic into '__main__' block