wrote test for average
fixed average test