Implemented MaxMin from handout.