restored max ascent calculation