updated to sqlite3 syntax