changed num to min