Move i type declaration to the beginning of main()