Extract extrema, fix indentation