The main function is better
added g_debug's for several structs