worked out update function a bit more, some modularization, problem with hpkgDatabase not passing through the entropy.