Small edits
Completed version which reads and writes to a db