Functioning main