Get Min and Get Max implementation