adding beginnings of database logic