main is first and foremost
remove excess structs
quit server by changing flag