fixed: empty average

+ improved: pear coding standard