update to use db and start adding stock functions