Doug/update

Setting max db size to 40000, updating how old history items are deleted