Added finding of the maximum