added semicolons, removed alter table commands from the top, and annotated everything better