Updated File structure

Chopped the scripted up to make the script more robust.