delete 'average' function and replace to 'numpy.mean'
simplify
remove unnecessary line