Adding main script

This is the entirety of the Python script.