Graphs fixed; query code modified slightly