Submit functionality

Untested
Fixed array syntax