Added global max test

Buggy under certain values