adds a function to populate db