adapted query 7 & 8