Les_engine Query Updates

Updating queries to use stored procedures and to account for all issues.