Use functions instead of main()