added SQL stuff