getting right answers for query 2