Changes following the coursera exercise in DB