All the SQL stuff done. Not yet working