Added initial logic to main.