Some more edits - added in averages and queries