Fixed a lot of database issues and added a join all QUERY