#46 extremum calculations added