small error with min functions