query 4 implemented