completed query 4, 5; TODO: query 2, proper ranking