removed redundancy in main