used numpy to take the mean