refactored database logic in a single query
removed extra recommendation/s function
Merge pull request #89 from neillobo/refactor/databaseLogic

refactored database logic in a single query