Add some SQL stuff. Made some style changes.