min/max/other adding to db, not implemented. public keys implemented, many unfinished things but almost done