query 7 and 8 may be inefficient