updated for the newer db format. First try