added code for grouping and calculating mean
fixed a typo