Refactored script to be a front end to submit