worked out unimosal array find max algorithm