getting the average deviation