commiting a lot of changes to both sql and the new logic for handling
kingdom updates