completing query 2 and query 3