reworked most of the main to get the layout good