wip update with query joins etc