Some changes.
Got the queries to work partially.