Merged database code with previous versions. This version is working on
my computer.