finalized and tested build-db.sh