Checking The Maximum Value Of A Function