Updating to work with SQL input
Moved over things to use SQL