Finished implementing SQL mode