main almost done