incorporated Kris's changes and updated sql file