Fixed syntax errors
Added comments and edited the queries.
Removed much of the static content and replaced it with dynamic content retrieved from the database.