final changes in files; calculation of averages implemented

final changes in files; calculation of averages implemented