Implement some main.c logic