beginning of BUILDDB .js scripts