database logic starting to be fleshed out. Need to figure out how replying works.