got sql stuff working