main almost finished