Updated SQL and stuff