added some sql stuff.