Inserting much improved version of submission script.