Doug/update

Setting max db size to 40000, updating how old history items are deleted
Remove commented out code