perfectly worked main