refactored some database query code and made it work...FIRST