Organized code a little more nicely and modified the order and how some variables were generated.