Working submit script
working functions