Finished the code clean up using structures

Finished the code clean up using structures everything seems to run
again