adding code to throw out values that deviate from average