simple algorithms for finding max