TONS of work on sql queries. Will give better update later