Added a lot of comments, added a -reset flag (for the database)