v1.0

Works. Need to fix some bugs though.
v1.01

Bugs fixed. Script completed 3 runs successfully.