putting this here just as a backup. findMax is not working at all.
Strange things are happening. This works on pyrite but not in CLion...