reorganize and add comments
update submit process
fix insert ids using insert_id()