Updated for readability

Changed variable declarations to start of code for proper declaration.