Structuring

Structured the code. Still needs to be indented properly.