Separated into functions, fixed var setup
Finalized basic structure, Redhat done