finished a class for avg and added an sql querry