Cleaned up code and made it more fluid.