added queries and updated erd