organized code into proper layout. Made lots of the peripheral things work