modified Q8.sql