added minOption and minOptionBy