Max, min, basic iteration implemented